﻿using ML.Entity;
using ML.IBusiness;
using System.Web.Mvc;

namespace ML.Web.Controllers
{
    /// <summary>
    /// 汇率首页控制器
    /// </summary>
    public class CurrencyController : BaseController
    {
        private readonly ICurrencyBusiness currencyBusiness;

        public CurrencyController(ICurrencyBusiness _currencyBusiness)
        {
            currencyBusiness = _currencyBusiness;
        }
        /// <summary>
        /// 汇率页面
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 根据查询条件查询汇率信息
        /// </summary>
        /// <param name="pfcSearch">汇率查询条件</param>
        /// <returns></returns>
        [HttpGet]
        [AjaxOnly]
        public ActionResult List(CurrencySearch currencySearch)
        {
            var data = currencyBusiness.List(currencySearch);
            return JsonDateTime(data.data);
        }
    }
}